﻿@using Ornament.Web
@model Ornament.MVCWebFrame.Areas.MemberShips.Models.PermissionWizard
@{
    Layout = "~/Views/Shared/App.cshtml";
}
@section PageTitle{
Please select resource's type
}
@using (Html.BeginForm())
{

    Html.RenderPartial("PermissionWizardDataView", this.Model);

    var i = 0;
    var foundSelected = false;
    foreach (var resourceType in OrnamentContext.Configuration.ResourceSettings)
    {
        foundSelected = resourceType.Name == this.Model.DescriptionResourceName;
    <div>
        @Html.RadioButton("DescriptionResourceName", resourceType.Name, resourceType.Name == this.Model.DescriptionResourceName, new { id = "ResourceType" + i })
        @Html.Label("ResourceType" + i, resourceType.Name)
    </div>
   i++;
    }

    if (!foundSelected)
    {
    <script type="text/javascript">
        $("#ResourceType0").attr("checked", true)
    </script>
    }
    
    <div>
        <button type="submit" id="next" value="true" name="forward">@Resources.Basic.Next
        </button>
        <button type="button" id="cancel">
            @Resources.Basic.Cancel</button>
    </div>
}